<!--策略终止-->
<template>
  <div class="bg">

    <div class="content bg3">

      <text class="title font36 text1">{{T('确认终止策略')}}</text>

      <div class="height60"></div>

      <VSwitc class="switc" ref="follow" v-model="cancelOrder" :maxWidth="400" :title="T('终止后撤销未成交的订单')"></VSwitc>

      <div class="height60"></div>
      <VSwitc class="switc" ref="follow" v-model="isConvert" :maxWidth="400" :title="T('终止后自动兑换成投入币种')" ></VSwitc>

      <div class="height60"></div>
      <text class="font28 text2">{{T('暂停的币对无法自动撤单、兑换，您可以启动暂停的币对后再操作。')}}</text>

      <div class="height60"></div>
      <div class="row ">
        <div class="but no1" @click="cancelClick"><text class="font32 text1">{{T('取消')}}</text></div>
        <div class="all"></div>
        <div class="but main1" @click="okClick"><text class="font32 text1">{{T('确认')}}</text></div>
      </div>
    </div>
  </div>
</template>

<script>


//组件
import VSwitc from "@/public/view/VSwitc.vue";

//功能
import navigator from "@/_js/navigator"; 
import broadcast from "@/_js/broadcast";


import I18N from "@/_i18n/i18n";
var T = I18N.t;

export default {

  components: {
    VSwitc,
  },

  data() {
    return {
      T:T,
      cancelOrder:true, //true 撤销订单
      isConvert:true, //true 兑换币种
      isOk:true,
    };
  },

  mounted() {
    
    var cancelOrder = navigator.getParam("cancelOrder");
    this.cancelOrder = (cancelOrder == undefined) ?  this.cancelOrder : cancelOrder;

    var isConvert = navigator.getParam("isConvert");
    this.isConvert = (isConvert == undefined) ? this.isConvert : isConvert;
  },

  methods: {
  
    /********************************** 点击触发*/
    //空白处点击
    cancelClick(){
      navigator.dismiss();
    },

    //确定点击
    okClick(){
      if (!this.isOk){
        return;
      }
      this.isOk = false;
      navigator.dismiss();
      var param = {'isConvert':this.isConvert, 'cancelOrder':this.cancelOrder};
      broadcast.send('RunStop',param);
    },
  }
}

</script>


<style src="@/_css/style.css"></style>
<style scoped>
/******************************************************* 手续费*/
.bg {
  flex-direction: row;
  justify-content: center;
  align-items: center;
  width: 750px;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}
.content {
  flex-direction: column;
  width: 642px;
  /* height: 582px; */
  background: #202B46;
  border-radius: 4px;

  padding-top: 60px;
  padding-bottom: 60px;
  padding-left: 50px;
  padding-right: 50px;
}


.switc{
  width: 542px;
}

.title {
  width: 542px;
  text-align: center;
}

.but{
  flex-direction: row;
  justify-content: center;
  align-items: center;
  width: 240px;
  height: 80px;
  border-radius: 4px;
}

/*开关*/

.height60 {
  height: 60px;
}
</style>